package com.lhj.xxsc.member.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.xxsc.common.utils.PageUtils;
import com.lhj.xxsc.member.entity.MemberEntity;
import com.lhj.xxsc.member.exception.PhoneExsitException;
import com.lhj.xxsc.member.exception.UserNameExistException;
import com.lhj.xxsc.member.to.SocialUserTo;
import com.lhj.xxsc.member.to.UserLoginTo;
import com.lhj.xxsc.member.to.UserRegistTo;

import java.util.Map;

/**
 * 会员
 *
 * @author leifengyang
 * @email leifengyang@gmail.com
 * @date 2019-10-08 09:47:05
 */
public interface MemberService extends IService<MemberEntity> {

	PageUtils queryPage(Map<String, Object> params);

	/**
	 * 会员注册
	 *
	 * @param to
	 */
	void regist(UserRegistTo to);

	/**
	 * 判断手机号码是否唯一
	 *
	 * @param phone
	 * @return
	 */
	void checkPhone(String phone) throws PhoneExsitException;

	/**
	 * 判断用户名是否唯一
	 *
	 * @param userName
	 * @return
	 */
	void checkUserName(String userName) throws UserNameExistException;


	/**
	 * 社交登录
	 *
	 * @param to
	 * @return
	 */
	MemberEntity login(SocialUserTo to) throws Exception;

	/**
	 * 登录功能
	 *
	 * @param to
	 * @return
	 */
	MemberEntity login(UserLoginTo to);
}

